3.17 \(\int \frac{\tan (x)}{\sqrt{a+a \cot ^2(x)}} \, dx\)

Optimal. Leaf size=36 \[ \frac{\tanh ^{-1}\left (\frac{\sqrt{a \csc ^2(x)}}{\sqrt{a}}\right )}{\sqrt{a}}-\frac{1}{\sqrt{a \csc ^2(x)}} \]

[Out]

ArcTanh[Sqrt[a*Csc[x]^2]/Sqrt[a]]/Sqrt[a] - 1/Sqrt[a*Csc[x]^2]

________________________________________________________________________________________

Rubi [A]  time = 0.0874944, antiderivative size = 36, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {3657, 4124, 51, 63, 207} \[ \frac{\tanh ^{-1}\left (\frac{\sqrt{a \csc ^2(x)}}{\sqrt{a}}\right )}{\sqrt{a}}-\frac{1}{\sqrt{a \csc ^2(x)}} \]

Antiderivative was successfully verified.

[In]

Int[Tan[x]/Sqrt[a + a*Cot[x]^2],x]

[Out]

ArcTanh[Sqrt[a*Csc[x]^2]/Sqrt[a]]/Sqrt[a] - 1/Sqrt[a*Csc[x]^2]

Rule 3657

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rule 4124

Int[((b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Dist[b/(2*f), Subst[In
t[(-1 + x)^((m - 1)/2)*(b*x)^(p - 1), x], x, Sec[e + f*x]^2], x] /; FreeQ[{b, e, f, p}, x] &&  !IntegerQ[p] &&
 IntegerQ[(m - 1)/2]

Rule 51

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*(c + d*x)^(n + 1
))/((b*c - a*d)*(m + 1)), x] - Dist[(d*(m + n + 2))/((b*c - a*d)*(m + 1)), Int[(a + b*x)^(m + 1)*(c + d*x)^n,
x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && LtQ[m, -1] &&  !(LtQ[n, -1] && (EqQ[a, 0] || (NeQ[
c, 0] && LtQ[m - n, 0] && IntegerQ[n]))) && IntLinearQ[a, b, c, d, m, n, x]

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{\tan (x)}{\sqrt{a+a \cot ^2(x)}} \, dx &=\int \frac{\tan (x)}{\sqrt{a \csc ^2(x)}} \, dx\\ &=-\left (\frac{1}{2} a \operatorname{Subst}\left (\int \frac{1}{(-1+x) (a x)^{3/2}} \, dx,x,\csc ^2(x)\right )\right )\\ &=-\frac{1}{\sqrt{a \csc ^2(x)}}-\frac{1}{2} \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a x}} \, dx,x,\csc ^2(x)\right )\\ &=-\frac{1}{\sqrt{a \csc ^2(x)}}-\frac{\operatorname{Subst}\left (\int \frac{1}{-1+\frac{x^2}{a}} \, dx,x,\sqrt{a \csc ^2(x)}\right )}{a}\\ &=\frac{\tanh ^{-1}\left (\frac{\sqrt{a \csc ^2(x)}}{\sqrt{a}}\right )}{\sqrt{a}}-\frac{1}{\sqrt{a \csc ^2(x)}}\\ \end{align*}

Mathematica [A]  time = 0.0353694, size = 49, normalized size = 1.36 \[ -\frac{\csc (x) \left (\sin (x)+\log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right )-\log \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right )\right )}{\sqrt{a \csc ^2(x)}} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[x]/Sqrt[a + a*Cot[x]^2],x]

[Out]

-((Csc[x]*(Log[Cos[x/2] - Sin[x/2]] - Log[Cos[x/2] + Sin[x/2]] + Sin[x]))/Sqrt[a*Csc[x]^2])

________________________________________________________________________________________

Maple [A]  time = 0.122, size = 56, normalized size = 1.6 \begin{align*} -{\frac{\sqrt{4}}{2\,\sin \left ( x \right ) } \left ( \sin \left ( x \right ) -\ln \left ( -{\frac{-1+\cos \left ( x \right ) -\sin \left ( x \right ) }{\sin \left ( x \right ) }} \right ) +\ln \left ( -{\frac{-1+\cos \left ( x \right ) +\sin \left ( x \right ) }{\sin \left ( x \right ) }} \right ) \right ){\frac{1}{\sqrt{-{\frac{a}{ \left ( \cos \left ( x \right ) \right ) ^{2}-1}}}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)/(a+a*cot(x)^2)^(1/2),x)

[Out]

-1/2*4^(1/2)*(sin(x)-ln(-(-1+cos(x)-sin(x))/sin(x))+ln(-(-1+cos(x)+sin(x))/sin(x)))/sin(x)/(-a/(cos(x)^2-1))^(
1/2)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(a+a*cot(x)^2)^(1/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 1.62029, size = 225, normalized size = 6.25 \begin{align*} \frac{{\left (\tan \left (x\right )^{2} + 1\right )} \sqrt{a} \log \left (2 \, a \tan \left (x\right )^{2} + 2 \, \sqrt{a} \sqrt{\frac{a \tan \left (x\right )^{2} + a}{\tan \left (x\right )^{2}}} \tan \left (x\right )^{2} + a\right ) - 2 \, \sqrt{\frac{a \tan \left (x\right )^{2} + a}{\tan \left (x\right )^{2}}} \tan \left (x\right )^{2}}{2 \,{\left (a \tan \left (x\right )^{2} + a\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(a+a*cot(x)^2)^(1/2),x, algorithm="fricas")

[Out]

1/2*((tan(x)^2 + 1)*sqrt(a)*log(2*a*tan(x)^2 + 2*sqrt(a)*sqrt((a*tan(x)^2 + a)/tan(x)^2)*tan(x)^2 + a) - 2*sqr
t((a*tan(x)^2 + a)/tan(x)^2)*tan(x)^2)/(a*tan(x)^2 + a)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\tan{\left (x \right )}}{\sqrt{a \left (\cot ^{2}{\left (x \right )} + 1\right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(a+a*cot(x)**2)**(1/2),x)

[Out]

Integral(tan(x)/sqrt(a*(cot(x)**2 + 1)), x)

________________________________________________________________________________________

Giac [A]  time = 1.23306, size = 66, normalized size = 1.83 \begin{align*} \frac{1}{2} \, \sqrt{a}{\left (\frac{\log \left (\sin \left (x\right ) + 1\right )}{a \mathrm{sgn}\left (\sin \left (x\right )\right )} - \frac{\log \left (-\sin \left (x\right ) + 1\right )}{a \mathrm{sgn}\left (\sin \left (x\right )\right )} - \frac{2 \, \sin \left (x\right )}{a \mathrm{sgn}\left (\sin \left (x\right )\right )}\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(a+a*cot(x)^2)^(1/2),x, algorithm="giac")

[Out]

1/2*sqrt(a)*(log(sin(x) + 1)/(a*sgn(sin(x))) - log(-sin(x) + 1)/(a*sgn(sin(x))) - 2*sin(x)/(a*sgn(sin(x))))